<template>
  <div>
    <router-view/>
    <van-tabbar v-model="active" route>
      <van-tabbar-item :to="{name: 'main'}" replace icon="home-o">标签</van-tabbar-item>
      <van-tabbar-item :to="{name: 'sort'}" replace icon="search">标签</van-tabbar-item>
      <van-tabbar-item icon="friends-o">标签</van-tabbar-item>
      <van-tabbar-item icon="setting-o">标签</van-tabbar-item>
      <van-tabbar-item icon="setting-o">标签</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script lang="ts" setup>
import {ref} from 'vue'
import {useRouter} from "vue-router";

const active = ref(0)
const router = useRouter()

const path = ['main', 'sort']
const switchTab = (active: number) => {
  // console.log(active)
  router.push({name: path[active]})
}
</script>

<style scoped>

</style>
